/*	Notes:
 * 		Collision - A radius or encompassing rectangle?
 */

import java.awt.*;

public class Actor {
	
	private GameInterface gi;
	private Level container; // this level contains this Actor
	
	private String imageFileName;
	
	private double x,y;
	private int width, depth;
	private double traversalSpeed; // in pixels per second?
	private Path p;
	
	private long updateTimeRemaining;
	
	private boolean isFlaggedForRemoval;
	
	public Actor(){}
	public Actor(Level cc, String cifn, double cx, double cy, int cw, int cd){
		container = cc;
		imageFileName = cifn;
		x = cx;
		y = cy;
		width = cw;
		depth = cd;
		isFlaggedForRemoval = false;
	}
	
	public void update(long l){}
	public void display(Graphics2D g){}
	
	public void act(long l){}
	/*	Method collision(Actor a, long l) -
	 * 		Long l will be the time at which the collision occurs. When this method is run, you will do a damage check/
	 * 		update with the l from the parameters in the collision method.
	 * 
	 */
	public void collision(Actor a, long l){} // long l will be the time at which the collision occurs (not the update long)
	
	public GameInterface getGameInterface(){return gi;}
	public Level getContainer(){return container;}
	public String getImageFileName(){return imageFileName;}
	public double getX(){return x;}
	public double getY(){return y;}
	public int getWidth(){return width;}
	public int getDepth(){return depth;}
	public double getTraversalSpeed(){return traversalSpeed;}
	public Path getPath(){return p;}
	public long getUpdateTimeRemaining(){return updateTimeRemaining;}
	public boolean getIsFlaggedForRemoval(){return isFlaggedForRemoval;}
	//public Rectangle getRectangle(){return new Rectangle(x,y,width,depth);} // may not be necessary? O_o
	/* 	Method collideWithActorAt(Actor a, long l) returns a timestamp of when a collision takes place between this actor
	 * 		and the one given in the parameters assuming there is a collision. If there is no collision present, the long
	 * 		returned will be -1. If there is to be a collision, the long will be saved temporarily and will be compared to
	 * 		when checking for collisions that could have possibly occurred before this one. If there is an earlier one,
	 * 		the current temporary long will be overwritten by the new, earlier collision timestamp. This will be used in
	 * 		the Level this Actor is in so the arrays can be used.
	 * 
	 * 	CORRECTION: KEEP ALL COLLISION TIMES IN CASE YOU DO NOT REMOVE THE ACTOR FROM FUTURE COLLISIONS.
	 * 
	 * 	The most basic part of the check basically takes two points at any given time in the Paths and compares the distance
	 * 		between the two to the sum of the two collision radii. If the distance between the two points is less than or
	 * 		equal to the sum of the two collision radii, there is a collision.
	 */
	public long collidesWithActorAt(Actor a, long l){
		
		
		
		return -1;
	} // need to configure correctly... too lazy ATM
	
	public void setGameInterface(GameInterface sgi){gi = sgi;}
	public void setContainer(Level sc){container = sc;}
	public void setImageFileName(String sifn){imageFileName = sifn;}
	public void setX(double sx){x = sx;}
	public void setY(double sy){y = sy;}
	public void setWidth(int sw){width = sw;}
	public void setDepth(int sd){depth = sd;}
	public void setTraversalSpeed(int sts){traversalSpeed = sts;}
	public void setPath(Path sp){p = sp;}
	public void setUpdateTimeRemaining(long sutr){updateTimeRemaining = sutr;}
	public void setIsFlaggedForRemoval(boolean siffr){isFlaggedForRemoval = siffr;}
}